/*******************************************************************************
 * WayStudio GUI Library
 * Developer:Xu Waycell
*******************************************************************************/
#include <layout.hpp>
#include <layoutimpl.hpp>

BEGIN_SOURCECODE

USING_WS_NAMESPACE

Map<Layout*, LayoutSpecific*> LayoutSpecific::SpecificMap;

LayoutSpecific* LayoutSpecific::Fetch(){
}

LayoutSpecific::LayoutSpecific(Layout* LAYOUT):H_Layout(LAYOUT), H_Parent(0) {}

LayoutSpecific::~LayoutSpecific() {}

Layout::LayoutImplementation::LayoutImplementation():H_Specific(0) {}

Layout::LayoutImplementation::~LayoutImplementation() {}

void Layout::LayoutImplementation::Initial(Layout* LAYOUT) {
	H_Specific = new LayoutSpecific(LAYOUT);
}

void Layout::LayoutImplementation::Cleanup() {
	if(H_Specific)
	{
		delete H_Specific;
		H_Specific=0;
	}
}

Layout::Layout(Widget* PARENT):Implementation(0) {
	Implementation = new LayoutImplementation;
	if(Implementation)
	{
		Implementation->Initial(this);
		Implementation->H_Specific->H_Parent=PARENT;
	}
	else
		throw;
}

Layout::~Layout() {
	if(Implementation)
	{
		Implementation->Cleanup();
		delete Implementation;

	}
}

END_SOURCECODE
